home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / lib / gcc-lib / ppc-amigaos / 2.95.1 / sys-include / mgl / minigl.h < prev    next >
C/C++ Source or Header  |  2000-03-13  |  9KB  |  486 lines

  1. /*
  2.  * $Id: minigl.h,v 1.4 2000/01/16 20:47:15 hfrieden Exp $
  3.  *
  4.  * $Author: hfrieden $
  5.  *
  6.  * $Date: 2000/01/16 20:47:15 $
  7.  * $Revision: 1.4 $
  8.  *
  9.  * (C) 1999 by Hyperion Software
  10.  * All rights reserved
  11.  *
  12.  * This file is part of the MiniGL library project
  13.  * See the file Licence.txt for more details
  14.  *
  15.  */
  16.  
  17. #ifndef __MINIGL_H_INLINES
  18. #define __MINIGL_H_INLINES
  19.  
  20. #ifndef MGLAPI
  21.     #if defined(__GNUC__)
  22.     #define MGLAPI static inline
  23.     #elif defined(__STORMC__)
  24.     #define MGLAPI __inline
  25.     #elif defined(VBCC)
  26.     #error "Don't have any idea ;("
  27.     #endif
  28. #endif
  29.  
  30. #define CC mini_CurrentContext
  31.  
  32. MGLAPI void glAlphaFunc(GLenum func, GLclampf ref)
  33. {
  34.     GLAlphaFunc(CC, func, ref);
  35. }
  36.  
  37. MGLAPI void glBegin(GLenum mode)
  38. {
  39.     GLBegin(CC, mode);
  40. }
  41.  
  42. MGLAPI void glBindTexture(GLenum target, GLuint texture)
  43. {
  44.     GLBindTexture(CC, target, texture);
  45. }
  46.  
  47. MGLAPI void glBlendFunc(GLenum sfactor, GLenum dfactor)
  48. {
  49.     GLBlendFunc(CC, sfactor, dfactor);
  50. }
  51.  
  52. MGLAPI void glClear(GLbitfield mask)
  53. {
  54.     GLClear(CC, mask);
  55. }
  56.  
  57. MGLAPI void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
  58. {
  59.     GLClearColor(CC, red, green, blue, alpha);
  60. }
  61.  
  62. MGLAPI void glClearDepth(GLclampd depth)
  63. {
  64.     GLClearDepth(CC, depth);
  65. }
  66.  
  67. MGLAPI void glColor3f(GLfloat red, GLfloat green, GLfloat blue)
  68. {
  69.     GLColor4f(CC, red, green, blue, 1.f);
  70. }
  71.  
  72. MGLAPI void glColor3fv(GLfloat *v)
  73. {
  74.     GLColor3fv(CC, v);
  75. }
  76.  
  77. MGLAPI void glColor3ubv(GLubyte *v)
  78. {
  79.     GLColor3ubv(CC, v);
  80. }
  81.  
  82. MGLAPI void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
  83. {
  84.     GLColor4f(CC, red, green, blue, alpha);
  85. }
  86.  
  87. MGLAPI void glColor4fv(GLfloat *v)
  88. {
  89.     GLColor4fv(CC, v);
  90. }
  91.  
  92. MGLAPI void glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
  93. {
  94.     GLColor4ub(CC, red, green, blue, alpha);
  95. }
  96.  
  97. MGLAPI void glColor4ubv(GLubyte *v)
  98. {
  99.     GLColor4ubv(CC, v);
  100. }
  101.  
  102. MGLAPI void glCullFace(GLenum mode)
  103. {
  104.     GLCullFace(CC, mode);
  105. }
  106.  
  107. MGLAPI void glDeleteTextures(GLsizei n, const GLuint *textures)
  108. {
  109.     GLDeleteTextures(CC, n, textures);
  110. }
  111.  
  112. MGLAPI void glDepthFunc(GLenum func)
  113. {
  114.     GLDepthFunc(CC, func);
  115. }
  116.  
  117. MGLAPI void glDepthMask(GLboolean flag)
  118. {
  119.     GLDepthMask(CC, flag);
  120. }
  121.  
  122. MGLAPI void glDepthRange(GLclampd n, GLclampd f)
  123. {
  124.     GLDepthRange(CC, n, f);
  125. }
  126.  
  127. MGLAPI void glDisable(GLenum cap)
  128. {
  129.     MGLSetState(CC, cap, GL_FALSE);
  130. }
  131.  
  132. MGLAPI void glDrawBuffer(GLenum mode)
  133. {
  134.     GLDrawBuffer(CC, mode);
  135. }
  136.  
  137. MGLAPI void glEnable(GLenum cap)
  138. {
  139.     MGLSetState(CC, cap, GL_TRUE);
  140. }
  141.  
  142. MGLAPI void glEnd(void)
  143. {
  144.     GLEnd(CC);
  145. }
  146.  
  147. MGLAPI void glFinish(void)
  148. {
  149.     GLFinish(CC);
  150. }
  151.  
  152. MGLAPI void glFlush(void)
  153. {
  154.     GLFlush(CC);
  155. }
  156.  
  157. MGLAPI void glFogf(GLenum pname, GLfloat param)
  158. {
  159.     GLFogf(CC, pname, param);
  160. }
  161.  
  162. MGLAPI void glFogi(GLenum pname, GLint param)
  163. {
  164.     GLFogf(CC, pname, (GLfloat)param);
  165. }
  166.  
  167. MGLAPI void glFogfv(GLenum pname, GLfloat *param)
  168. {
  169.     GLFogfv(CC, pname, param);
  170. }
  171.  
  172. MGLAPI void glFrontFace(GLenum mode)
  173. {
  174.     GLFrontFace(CC, mode);
  175. }
  176.  
  177. MGLAPI void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
  178. {
  179.     GLFrustum(CC, left, right, bottom, top, zNear, zFar);
  180. }
  181.  
  182. MGLAPI void glGenTextures(GLsizei n, GLuint *textures)
  183. {
  184.     GLGenTextures(CC, n, textures);
  185. }
  186.  
  187. MGLAPI GLenum glGetError(void)
  188. {
  189.     return GLGetError(CC);
  190. }
  191.  
  192. MGLAPI void glGetFloatv(GLenum pname, GLfloat *params)
  193. {
  194.     GLGetFloatv(CC, pname, params);
  195. }
  196.  
  197. MGLAPI const GLubyte * glGetString(GLenum name)
  198. {
  199.     return GLGetString(CC, name);
  200. }
  201.  
  202. MGLAPI void glHint(GLenum target, GLenum mode)
  203. {
  204.     GLHint(CC, target, mode);
  205. }
  206.  
  207. MGLAPI void glLoadIdentity(void)
  208. {
  209.     GLLoadIdentity(CC);
  210. }
  211.  
  212. MGLAPI void glLoadMatrixd(const GLdouble *m)
  213. {
  214.     GLLoadMatrixd(CC, m);
  215. }
  216.  
  217. MGLAPI void glLoadMatrixf(const GLfloat *m)
  218. {
  219.     GLLoadMatrixf(CC, m);
  220. }
  221.  
  222. MGLAPI void glMatrixMode(GLenum mode)
  223. {
  224.     GLMatrixMode(CC, mode);
  225. }
  226.  
  227. MGLAPI void glMultMatrixd(const GLdouble *m)
  228. {
  229.     GLMultMatrixd(CC, m);
  230. }
  231.  
  232. MGLAPI void glMultMatrixf(const GLfloat *m)
  233. {
  234.     GLMultMatrixf(CC, m);
  235. }
  236.  
  237. MGLAPI void glNormal3f(GLfloat x, GLfloat y, GLfloat z)
  238. {
  239.     GLNormal3f(CC, x, y, z);
  240. }
  241.  
  242. MGLAPI void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
  243. {
  244.     GLOrtho(CC, left, right, bottom, top, zNear, zFar);
  245. }
  246.  
  247. MGLAPI void glPixelStorei(GLenum pname, GLint param)
  248. {
  249.     GLPixelStorei(CC, pname, param);
  250. }
  251.  
  252. MGLAPI void glPolygonMode(GLenum face, GLenum mode)
  253. {
  254.     GLPolygonMode(CC, face, mode);
  255. }
  256.  
  257. MGLAPI void glPopMatrix(void)
  258. {
  259.     GLPopMatrix(CC);
  260. }
  261.  
  262. MGLAPI void glPushMatrix(void)
  263. {
  264.     GLPushMatrix(CC);
  265. }
  266.  
  267. MGLAPI void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
  268. {
  269.     GLReadPixels(CC, x, y, width, height, format, type, pixels);
  270. }
  271.  
  272. MGLAPI void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
  273. {
  274.     GLRotatef(CC, angle, x, y, z);
  275. }
  276.  
  277. MGLAPI void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
  278. {
  279.     GLRotated(CC, angle, x, y, z);
  280. }
  281.  
  282. MGLAPI void glScalef(GLfloat x, GLfloat y, GLfloat z)
  283. {
  284.     GLScalef(CC, x, y, z);
  285. }
  286.  
  287. MGLAPI void glScaled(GLdouble x, GLdouble y, GLdouble z)
  288. {
  289.     GLScaled(CC, x, y, z);
  290. }
  291.  
  292. MGLAPI void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
  293. {
  294.     GLScissor(CC, x, y, width, height);
  295. }
  296.  
  297. MGLAPI void glShadeModel(GLenum mode)
  298. {
  299.     GLShadeModel(CC, mode);
  300. }
  301.  
  302. MGLAPI void glTexCoord2f(GLfloat s, GLfloat t)
  303. {
  304.     GLTexCoord2f(CC, s, t);
  305. }
  306.  
  307. MGLAPI void glTexCoord2fv(GLfloat *v)
  308. {
  309.     GLTexCoord2fv(CC, v);
  310. }
  311.  
  312. MGLAPI void glTexEnvf(GLenum target, GLenum pname, GLfloat param)
  313. {
  314.     GLTexEnvi(CC, target, pname, (GLint)param);
  315. }
  316.  
  317. MGLAPI void glTexEnvi(GLenum target, GLenum pname, GLint param)
  318. {
  319.     GLTexEnvi(CC, target, pname, param);
  320. }
  321.  
  322. MGLAPI void glTexGeni(GLenum coord, GLenum mode, GLenum map)
  323. {
  324.     GLTexGeni(CC, coord, mode, map);
  325. }
  326.  
  327. MGLAPI void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
  328. {
  329.     GLTexImage2D(CC, target, level, internalformat, width, height, border, format, type, pixels);
  330. }
  331.  
  332. MGLAPI void glTexParameteri(GLenum target, GLenum pname, GLint param)
  333. {
  334.     GLTexParameteri(CC, target, pname, param);
  335. }
  336.  
  337. MGLAPI void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
  338. {
  339.     GLTexSubImage2D(CC, target, level, xoffset, yoffset, width, height, format, type, pixels);
  340. }
  341.  
  342. MGLAPI void glTranslated(GLdouble x, GLdouble y, GLdouble z)
  343. {
  344.     GLTranslated(CC, x, y, z);
  345. }
  346.  
  347. MGLAPI void glTranslatef(GLfloat x, GLfloat y, GLfloat z)
  348. {
  349.     GLTranslatef(CC, x, y, z);
  350. }
  351.  
  352. MGLAPI void glVertex2f(GLfloat x, GLfloat y)
  353. {
  354.     GLVertex4f(CC, x, y, 0.f, 1.f);
  355. }
  356.  
  357. MGLAPI void glVertex3f(GLfloat x, GLfloat y, GLfloat z)
  358. {
  359.     GLVertex4f(CC, x, y, z, 1.f);
  360. }
  361.  
  362. MGLAPI void glVertex3fv(GLfloat *v)
  363. {
  364.     GLVertex3fv(CC, v);
  365. }
  366.  
  367. MGLAPI void glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
  368. {
  369.     GLVertex4f(CC, x, y, z, w);
  370. }
  371.  
  372. MGLAPI void glVertex4fv(GLfloat *v)
  373. {
  374.     GLVertex4fv(CC, v);
  375. }
  376.  
  377. MGLAPI void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
  378. {
  379.     GLViewport(CC, x, y, width, height);
  380. }
  381.  
  382. MGLAPI void * mglCreateContext(int offx, int offy, int w, int h)
  383. {
  384.     CC = (GLcontext)MGLCreateContext(offx, offy, w,h);
  385.     return (void *)CC;
  386. }
  387.  
  388. MGLAPI void mglDeleteContext(void)
  389. {
  390.     MGLDeleteContext(CC);
  391. }
  392.  
  393. MGLAPI void mglEnableSync(GLboolean enable)
  394. {
  395.     MGLEnableSync(CC, enable);
  396. }
  397.  
  398. MGLAPI void mglExit(void)
  399. {
  400.     MGLExit(CC);
  401. }
  402.  
  403. MGLAPI void * mglGetWindowHandle(void)
  404. {
  405.     return MGLGetWindowHandle(CC);
  406. }
  407.  
  408. MGLAPI void mglIdleFunc(IdleFn i)
  409. {
  410.     MGLIdleFunc(CC, i);
  411. }
  412.  
  413. MGLAPI void mglKeyFunc(KeyHandlerFn k)
  414. {
  415.     MGLKeyFunc(CC, k);
  416. }
  417.  
  418. MGLAPI GLboolean mglLockDisplay(void)
  419. {
  420.     return MGLLockDisplay(CC);
  421. }
  422.  
  423. #ifdef AUTOMATIC_LOCKING_ENABLE
  424. MGLAPI void mglLockMode(GLenum lockMode)
  425. {
  426.     MGLLockMode(CC, lockMode);
  427. }
  428. #endif
  429.  
  430. MGLAPI void mglMainLoop(void)
  431. {
  432.     MGLMainLoop(CC);
  433. }
  434.  
  435. MGLAPI void mglMouseFunc(MouseHandlerFn m)
  436. {
  437.     MGLMouseFunc(CC, m);
  438. }
  439.  
  440. MGLAPI void mglResizeContext(GLsizei width, GLsizei height)
  441. {
  442.     MGLResizeContext(CC, width, height);
  443. }
  444.  
  445. MGLAPI void mglPrintMatrix(GLenum mode)
  446. {
  447.     MGLPrintMatrix(CC, mode);
  448. }
  449.  
  450. MGLAPI void mglPrintMatrixStack(GLenum mode)
  451. {
  452.     MGLPrintMatrixStack(CC,mode);
  453. }
  454.  
  455. MGLAPI void mglSpecialFunc(SpecialHandlerFn s)
  456. {
  457.     MGLSpecialFunc(CC, s);
  458. }
  459.  
  460. MGLAPI void mglSwitchDisplay(void)
  461. {
  462.     MGLSwitchDisplay(CC);
  463. }
  464.  
  465. MGLAPI void mglUnlockDisplay(void)
  466. {
  467.     MGLUnlockDisplay(CC);
  468. }
  469.  
  470. MGLAPI void mglWriteShotPPM(char *filename)
  471. {
  472.     MGLWriteShotPPM(CC, filename);
  473. }
  474.  
  475. MGLAPI void mglTexMemStat(GLint *Current, GLint *Peak)
  476. {
  477.     MGLTexMemStat(CC, Current, Peak);
  478. }
  479.  
  480. MGLAPI void mglSetZOffset(GLfloat offset)
  481. {
  482.     MGLSetZOffset(CC, offset);
  483. }
  484.  
  485. #endif
  486.